package vip.liux.contracts.repositories.product;

import org.springframework.data.repository.ListCrudRepository;
import org.springframework.data.repository.ListPagingAndSortingRepository;
import org.springframework.data.repository.NoRepositoryBean;
import vip.liux.contracts.models.product.ProductDetail;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

@NoRepositoryBean
public interface ProductDetailRepository extends ListPagingAndSortingRepository<ProductDetail, Long>, ListCrudRepository<ProductDetail, Long> {
    List<ProductDetail> findBySpu(String spu);

    Optional<ProductDetail> findBySku(String sku);

    List<ProductDetail> findBySpuIn(Collection<String> spus);

    long deleteBySpu(String spu);

    List<ProductDetail> findBySkuIn(Collection<String> skus);
}